package cn.kill.orderservice.service.alipay.impl;

import cn.kill.orderservice.config.AlipayConfig;
import cn.kill.orderservice.pojo.PayOrder;
import cn.kill.orderservice.service.order.OrderService;
import cn.kill.orderservice.service.alipay.AliPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 张在成
 */
@Service
public class AliPayServiceImpl implements AliPayService {

    @Autowired
    private OrderService orderService;

    @Override
    public String nativePay(String body, double money) {
        try{
            PayOrder order=orderService.saveOrder(body,money);
            if (order==null){
                throw  new Exception("订单保存失败");
            }

        }catch (Exception e){
            e.printStackTrace();
        }

//        String result = AlipayConfig.nativePay(AlipayConfig.APPID);


        return null;
    }
}
